package mo.offer_version2;

import java.util.Arrays;
import java.util.stream.Collectors;

public class L45 {

    public String minNumber(int[] nums) {
        return Arrays.stream(nums).boxed().map(String::valueOf).sorted((s1, s2) -> {
            return (s1 + s2).compareTo(s2 + s1);
        }).collect(Collectors.joining());
    }

    public static void main(String[] args) {
        L45 test = new L45();
        System.out.println(test.minNumber(new int[]{128, 12}));
    }
}
